﻿///<copyright>
/// Copyright © 2009 Stephen Styrchak. All Rights Reserved.
///</copyright>
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace Ferpect.ComponentModel.Design
{
    public partial class DesignScreen : UserControl
    {
        private bool selected;

        public DesignScreen()
        {
            InitializeComponent();
        }

        [Category("Appearance")]
        [Browsable(true)]
        public override string Text
        {
            get { return this.screenName.Text; }
            set { this.screenName.Text = value; }
        }

        [Category("State")]
        public bool Selected
        {
            get { return this.selected; }
            set
            {
                if (value)
                {
                    this.BackColor = SystemColors.GradientActiveCaption;
                }
                else if (this.Parent != null)
                {
                    this.BackColor = this.Parent.BackColor;
                }
                this.selected = value;
            }
        }

        protected override void OnClick(EventArgs e)
        {
            this.Selected = !this.Selected;
            base.OnClick(e);
        }
    }
}
